<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>登录</title>
<link rel="stylesheet" href="css/lgoin.css" />
<script type="text/javascript" src="js/jquery.min.js" ></script>
</head>
<body>
     
    <div class="logindiv">
    	
    	用户名:<input type="text" id="user"/> <br /><br />
    	密码:<input type="password" class="passInput" id="passwd"/>
    	<br /><br />
    	<input  type="button" class="button" value="登录" onclick="login()" />
    </div>
    <div id="msg" class="msgDiv"></div>
</body>
<script>
	var domain = "http://127.0.0.1:9191/";
	function login(){
		var user = $("#user").val();
		var passwd = $("#passwd").val();
		if(!user || !passwd)
		{
			$("#msg").html("用户名或密码不能为空")
		}else{
			$("#msg").html("")
			$.ajax({
				type:"post",
				url:domain+"loginPost",
				async:true,
				data:{"account":user,"password":passwd},
				success:function(result){
					$("#msg").html(result.message);
					window.location.href=domain;
				},
				error:function(result){
					alert(系统异常);
				}
			});
		}
		
	}
</script>
</html>